import { Body, Controller, Post } from '@nestjs/common';
import { AuthService } from './auth.service';
import { userDto } from 'src/user/dto/user.dto';
import { Web3Service } from 'src/web3/web3.service';
@Controller('auth')
export class AuthController {
  constructor(private authService: AuthService, private web3: Web3Service) { }

  //登录
  @Post('/sign-in')
  async signIn(@Body() dto: userDto) {
    const { name, password } = dto;
    const res = await this.authService.signin(name, password);
    return {statusCode: 201,res};
  }
  
  //注册
  @Post('/sign-up')
  async signUp(@Body() userDto: userDto) {
    const res=await this.authService.signup(userDto);
    return {statusCode:201,res};
  }
}
